/*
 * @Author: weisheng
 * @Date: 2023-04-17 12:51:22
 * @LastEditTime: 2023-04-20 15:01:53
 * @LastEditors: weisheng
 * @Description:
 * @FilePath: \uniapp-vue3-fant-ts\src\api\DemoApi.ts
 * 记得注释
 */
import http from '@/http/HttpClient'
import { LoginModel, categoryModel } from '@/model/BaseResponse'

export const loginAPI = (params: LoginModel) => {
  return http
    .server()
    .post('/userbusiness-service/userlogin/loginOrRegForMoblie.json?tel=' + params.tel + '&smsCode=' + params.smsCode, {}, {})
    .then((res) => {
      return res.data
    })
}

export const getCategoryList = () => {
  return http
    .server()
    .get('/inventory-service/assetShopMall/queryCategories.json', {})
    .then((res) => {
      return res.data
    })
}

export const getProductListWithCategory = (params: categoryModel) => {
  return http
    .server()
    .get(
      '/inventory-service/assetShopMall/getShopGoodsByCategory.json?pageSize=' +
        params.pageSize +
        '&pageNum=' +
        params.pageNum +
        '&categoryId=' +
        params.categoryId,
      {}
    )
    .then((res) => {
      return res.data
    })
}
